Skip to content

feat(superagent): inbox and workers schedulers with DSH - #7641

Open
openviking-superagent wants to merge 8 commits into
volcengine:feat/vikafrom
openviking-superagent:feat/superagent-router-worker-dsh
Open

openviking-superagent wants to merge 8 commits into
volcengine:feat/vikafrom
openviking-superagent:feat/superagent-router-worker-dsh

Conversation

@openviking-superagent

@openviking-superagent openviking-superagent commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Ports #7227 onto the current feat/vika / OpenViking SuperAgent baseline and adds DSH as a Router + Worker runtime.

The port preserves the original scheduler behavior:

  • legacy: immediate steering, with the previous prompt, tools, policyHash and schema.
  • inbox: durable waiting inputs, notices, message_check, oldest-first wake-up and freshness-fence interplay.
  • workers: the main session routes longer work with task_create / task_route; workers only read and report, while the router remains the only delivery outlet. Task state, input claims, 3+1 slots, retries and durable report delivery remain in TaskManager / SQLite.

Current-baseline adaptation

  • Moved the implementation from vika/ to superagent/.
  • Renamed scheduler configuration to OV_SUPERAGENT_SCHEDULER and retained current DSH, OneBot and server-fence changes.
  • Resolved the current directory layout and configuration conflicts without changing the scheduler state machine.

DSH worker adapter

  • Keeps the Router and all Workers in one DSH profile, sharing DSH_HOME, model routes and credentials.
  • Adds the ov-superagent-worker preset and creates/resumes one native DSH session per task through agents.create/resume.
  • Maps WorkerExecutor.start/done/stop to superagent/worker/ensure → submit → wait/cancel over the existing stdio JSON-RPC bridge.
  • Uses stable task/turn request IDs for duplicate submission suppression.
  • Registers the existing Core worker tools per session with turn-scoped authority; expiry and cancellation are session-local.
  • Keeps independent worker turns and usage/result handling in the shared process. A profile disconnect follows the existing TaskManager recovery path.
  • Leaves Pi, Codex and Claude worker execution unchanged.

Windows adaptation

  • The worker preset selects native pwsh on Windows and bash on Unix through the platform adapter.
  • Core action IPC uses localSocketPath, including Windows named pipes, in production and live tests.
  • Added Unix/Windows preset selection tests and retained platform process-lifecycle semantics.

Validation

  • npm run check: passed.
  • Real DSH 0.2.2-rc.1 check:dsh: passed, including worker preset creation, Core tool registration, duplicate submit suppression, independent cancellation and wait settlement.
  • Live WorkerExecutor test with a local fake provider: two DSH workers completed independent real model turns concurrently in one profile, with separate prompts, results and usage.
  • DSH live/adapter targeted tests: 31 passed.
  • Full test run with DSH enabled: 1925 passed, 13 skipped, 0 failed.
  • Fixed the two pre-existing portable-test failures: the root-dependent backup permission test now injects EACCES deterministically, and the OneBot permission-preservation test sets its initial mode explicitly instead of depending on umask.

Windows native shell and IPC paths are covered by tests; Windows real-machine verification remains follow-up platform testing.

krsish and others added 5 commits November 14, 2026 00:38
agents[].scheduler (default legacy) picks how accepted inputs reach the
model. With inbox, an input that arrives while a turn runs waits in an inbox:
the model gets one [daemon inbox] notice per burst (which chats, how many,
who; never the text) and reads the inputs oldest first with message_check at
a checkpoint. An idle runtime starts a turn with the oldest waiting inputs.

Inputs are delivered through AgentRuntime.submit, so adapters book them like
steered input (journal, inbound seqs, decision check). A delivery held by the
freshness fence while newer input there still waits delivers that input.
Waiting inputs persist in inbox_pending (created on first use) and survive a
restart. Legacy keeps prompt, tools, policyHash and schema unchanged; Ark
rejects inbox, OpenCode gets no mid-turn notices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agents[].scheduler workers makes the main session a router on top of the
inbox: it answers what is quick and hands longer work to a task with
task_create (task_route, task_stop, task_list). A worker is a separate
session on the router's own runtime, run one turn at a time in its
non-interactive mode (pi --mode json -p, codex exec, claude --print), so an
idle task holds no process. It reads with the Core read tools under an
authority valid for its turn, pulls new inputs with task_check, and reports
with task_report; it can deliver nothing.

Reports reach the router through the inbox as quoted [task report] lines and
the router relays them where the request was made, so it stays the only
outlet and every delivery check applies. A result is relayed only after the
worker read what the requester added during its turn. Tasks, inputs and
reports live in SQLite; a restart resumes a cut turn with a recovery note.
Inputs carry a [daemon tasks] line naming tasks they may belong to. Three
turns run at once plus a slot kept for follow-ups. On Pi the router's own
shell is capped at 30 s and may not sleep. Routing an input records it as
decided; OnIt stays up while its task's worker runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@openviking-superagent
openviking-superagent force-pushed the feat/superagent-router-worker-dsh branch from 1af7d4c to a058c7e Compare November 13, 2026 17:35
…dows

The generated fake Codex imports the action client by absolute path. A Windows path embedded verbatim in an ESM specifier is parsed as protocol 'd:' and the child exits with ERR_UNSUPPORTED_ESM_URL_SCHEME, so the inbox and workers integration tests cannot start their runtime on Windows. Emit a file URL instead; it is valid on every platform.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants